<template>
  <div class="history-wrapper">
    <h4>历史记录：</h4>
    <div
      class="his-item"
      v-for="item in hisList"
      :key="item.time"
      @click="search(item.value)"
    >
      {{ item.value }}
    </div>
  </div>
</template>

<script>
export default {
  props: {
    hisList: {
      type: Array,
      default: () => [],
    },
  },
  methods: {
    search(value) {
      this.$emit('search', value);
    },
  },
};
</script>

<style lang="less" scoped>
.his-item {
  padding: 10px;
  background: #eee;
  border-radius: 10px;
  margin-left: 10px;
  margin-top: 10px;
  display: inline-block;
}
</style>
